import request from "@/utils/http"
import type { SkuInfo } from'@/types/SkuModule';

// 添加收藏
export const addCollectApi = (skuId: number) => {
  return request({
    url:`ums/front/mCollect/add/${skuId}`,
    method:'POST',
  })
}

// 判断是否收藏
export const isCollectApi = (spuId: number) => {
  return request<Boolean>({
    url:`ums/front/mCollect/isCollect/${spuId}`,
    method:'GET',
  })
}

// 删除收藏
export const deleteCollectApi = (spuIds: number[]) => {
  return request<Boolean>({
    url:"ums/front/mCollect/delete",
    method:'DELETE',
    data:spuIds,
  })
}

// 查询收藏
export const getCollectInfoApi = () => {
  return request<SkuInfo[]>({
    url:"search/front/collect",
    method:'GET',
  })
}